<?
require("config.php");

$location_status .= "| Delete";
$show_backnav = "ban_menu";
$menuname = NULL;
$menutarget = NULL;

if (NULL!=$action){

	$Query = "DELETE FROM $table WHERE id=$id";
	myQuery($Query);

   header("location:" . $rela_path . "share/msg.php?v=67");

   exit();

}else{

  if (!checkRecord($table,$id)){

	header("location:" . $rela_path . "share/msg.php?v=9002");

	exit();
  
  }

}


$Query = "SELECT 
code,
name, 
picture,
publish,
page,
pos,
product 
FROM $table WHERE id=$id LIMIT 1";

$r=myQuery($Query);

$Code=$r[0][0];
$name=$r[0][1];
$Picture=$r[0][2];
$Publish=$r[0][3];
$page=$r[0][4];
$pos=$r[0][5];
$product=$r[0][6];

$Query="select code from pro_basic where id=$product";
$r=myQuery($Query);
$pro_code=$r[0][0];


require($rela_path . "inc/header.php");

?>
<form action="" method="post" enctype="multipart/form-data" name="form1">
<input name="action" type="hidden" value="delete">
<input name="id" type="hidden" value="<?print($id)?>">




<table width="95%" border="0" align="center">
  <tr> 
      <td valign="top"> <p><br>
          <br>
          Are you sure to delete this Banner ? 
          <input type="submit" class="button" name="Submit2" value="  Yes  ">
          <input type="button" class="button" name="Submit3" value="  No  " onClick="Redirect('ban_menu.php',1);">
          <br>
          <br>
        <table border="0" cellspacing="5" cellpadding="1">
          <tr> 
            <td class="tdheader">Code :</td>
            <td><?print($Code)?></td>
          </tr>
          <tr> 
            <td class="tdheader">Name : </td>
            <td><?print($name)?></td>
          </tr>
          <tr>
            <td class="tdheader">Picture :</td>
            <td><?loadImage2($Picture,$rela_path . $PIC_DIR. "pro_ban/")?></td>
          </tr>

          <tr> 
            <td class="tdheader">Publish : </td>
            <td><? if ($Publish) echo 'Yes'; else echo 'No' ;?></td>
          </tr>

          <tr>
            <td valign="top" class="tdheader">Show on :</td>
            <td><?
				if (substr_count($page,'H|')) echo 'Home <br>';
				if (substr_count($page,'CO|')) echo 'Contact <br>'; 
				if (substr_count($page,'CU|')) echo 'Customer Service <br>'; 
				if (substr_count($page,'D|')) echo 'Dealer <br>'; 
				if (substr_count($page,'S|')) echo 'Search <br>'; 
				if (substr_count($page,'PC|')) echo 'Product Category <br>'; 
				if (substr_count($page,'P|')) echo 'Product Detail <br>'; 
				if (substr_count($page,'T|')) echo 'Terms / Privacy <br>'; 
				?>
            </td>
          </tr>
          <tr> 
            <td class="tdheader">Order : </td>
            <td><?
				switch ($pos) {
					case 1: echo '1st <br>';
							break;
					case 2: echo '2nd <br>';
							break;
					case 3: echo '3rd <br>';
							break;
					case 4: echo '4th <br>';
							break;
					case 5: echo '5th <br>';
							break;
				}
				?>							
			</td>
          </tr>
          <tr> 
            <td class="tdheader">Product : </td>
			<td><?=$pro_code?></td></tr>
        </table>
        <p>
        <p> 
        <p> </td>

  </tr>
</table>
<br>
<br>
<br>


</form>
<?
require($rela_path . "inc/footer.php");
?>
